package com.wzy.webflux.enpty;

import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@Document(collection = "user")
@Data
public class User {
    @Id
    private String id;
    @NotBlank(message = "名字不能为空")
    private String name;
    @NotNull
    @Range(min = 10, max = 100, message = "年龄范围必须10-100之间")
    private int age;
}
